home *** CD-ROM | disk | FTP | other *** search
- ┌──────────────────────────────────────────────────────────────────────────────┐
- │ D O S B O O T R E C O R D │
- ├───┬───────┬──────────────────────────────────────────────────────────────────┤
- │00h│3 bytes│ JMP to executable code. For DOS 2.x, 3 byte near jump (0E9h). │
- │ │ │ For DOS 3.x, 2 byte near jump (0EBh) followed by a NOP (90h) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │03h│8 bytes│ optional OEM name and version (such as IBM 2.1) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │0Bh│2 bytes│ bytes per sector │
- ├───┼───────┼─────┬────────────────────────────────────────────────────────────┤
- │0Dh│ byte │ │ sectors per allocation unit (must be a power of 2) │
- ├───┼───────┤ ├────────────────────────────────────────────────────────────┤
- │0Eh│2 bytes│ B │ reserved sectors (starting at logical sector 0) │
- │ │ │ │ 01 for 1.x-3.31, 02 for 4.0+ │
- ├───┼───────┤ ├────────────────────────────────────────────────────────────┤
- │10h│ byte │ │ number of FATs │
- ├───┼───────┤ ├────────────────────────────────────────────────────────────┤
- │11h│2 bytes│ │ maximum number of root directory entries │
- ├───┼───────┤ P ├────────────────────────────────────────────────────────────┤
- │13h│2 bytes│ │ number of sectors in logical image (total number of │
- │ │ │ │ sectors in media, including boot sector directories, etc.)│
- │ │ │ │ If logical disk size is geater than 32Mb, this value is 0 │
- │ │ │ │ and the actual size is reported at offset 26h (DOS 4.0+) │
- ├───┼───────┤ ├────────────────────────────────────────────────────────────┤
- │15h│ byte │ B │ media descriptor byte │
- ├───┼───────┤ ├────────────────────────────────────────────────────────────┤
- │16h│2 bytes│ │ number of sectors occupied by a single FAT │
- ├───┼───────┼─────┴────────────────────────────────────────────────────────────┤
- │18h│2 bytes│ sectors per track │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │1Ah│2 bytes│ number of heads │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │1Ch│2 bytes│ # of hidden sectors (sectors before this volume) (1st part) │
- └───┴───────┼──────────────────────────────────────────────────────────────────┤
- │ EXTENDED BOOT RECORD (DOS 4.0+) │
- ┌───┬───────┼──────────────────────────────────────────────────────────────────┤
- │1Eh│2 bytes│ # of hidden sectors (sectors before this volume) (2nd part) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │20h│4 bytes│ # sectors in this disk (see offset 13h, if 0) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │24h│2 bytes│ physical drive number (max 2 for DOS 4, max 8 for DOS 5) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │26h│ byte │ extended boot record signature (29h) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │27h│4 bytes│ volume serial number (assigned with a random function) │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │2Bh│11 byte│ volume label │
- ├───┼───────┼──────────────────────────────────────────────────────────────────┤
- │36h│7 bytes│ file system ID (FAT12 ), (FAT16 ) etc. ("reserved") │
- └───┴───────┴──────────────────────────────────────────────────────────────────┘
-
- The three words at the end return information about the media. The number of
- heads is useful for supporting different multihead drives that have the same
- storage capacity but a different number of surfaces. The number of hidden
- sectors is useful for drive partitioning schemes.
-
- DOS 3.2 uses a table called the BIOS Parameter Block (BPB) to determine if a
- disk has a valid File Allocation Table. The BPB is located in the first sector
- of a floppy disk. Although the BPB is supposed to be on every formatted floppy
- disk, some earlier versions of DOS did not create a BPB and instead assumed that
- the FAT begins at the second sector of the disk and that the first FAT byte
- (Media Descriptor Byte) describes the disk format.
- DOS 3.2 reads in the whole of the BPB and tries to use it - although strangely
- enough, it seems as if DOS is prepared to cope with a BPB that is more or less
- totally blank (it seems to ignore the descriptor byte and treat it as a DSDD
- 9-sector disk).
- DOS 3.2 determines if a disk has a valid boot sector by examining the first
- byte of logical sector 0. If that byte it a jump instruction 0E9h, DOS 3.2
- assumes the rest of the sector is a valid boot sector with a BPB. If the first
-